#CommandLine Parser Makefile
CC?=clang
CXX?=clang++
AR=ar
LIBRARY=libCommandLineArguments.a
CFLAGS=-c -Iinclude
CXXFLAGS=-c -std=c++11 -Iinclude
CXXFLAGSTEST=-std=c++11 -Iinclude
COBJ=EncodingC.o
CXXOBJ=CommandLineArguments.o EncodingCXX.o


all:$(LIBRARY)

$(LIBRARY):$(COBJ) $(CXXOBJ)
	$(AR) rcs $(LIBRARY) $(CXXOBJ) $(COBJ) 
	

$(COBJ): %.o: sources/%.c
	$(CC) $(CFLAGS)  $< -o $@


$(CXXOBJ): %.o: sources/%.cxx
	$(CXX) $(CXXFLAGS)  $< -o $@

test:$(LIBRARY) cmdline.cxx
	$(CXX) $(CXXFLAGSTEST) cmdline.cxx $(LIBRARY) -o cmdline

clean:
	-rm *.o $(LIBRARY) 
	

